<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">











<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>NPanday - </title>
    <style type="text/css" media="all">
      @import url("./css/maven-base.css");
      @import url("./css/maven-theme.css");
      @import url("./css/site.css");
    </style>
    <link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
      </head>
  <body class="composite">
    <div id="banner">
                    <span id="bannerLeft">
    
            NPanday :: Compile Maven Plugin
    
            </span>
                    <div class="clear">
        <hr/>
      </div>
    </div>
    <div id="breadcrumbs">
          
  

  
    
  
  
    
            <div class="xleft">
        Last Published: 2010-06-22
                      </div>
            <div class="xright">            <a href="http://incubator.apache.org/projects/npanday.html" class="externalLink">Project Site</a>
            |
                <a href="http://incubator.apache.org/npanday" class="externalLink">NPanday</a>
            |
                <a href="http://svn.apache.org/repos/asf/incubator/npanday/" class="externalLink">NPanday SVN</a>
            |
                <a href="http://maven.apache.org/" class="externalLink">Maven</a>
            |
                <a href="http://www.mono-project.com/" class="externalLink">Mono Project</a>
            |
                <a href="http://dotgnu.org/" class="externalLink">DotGNU</a>
            
  

  
    
  
  
    
  </div>
      <div class="clear">
        <hr/>
      </div>
    </div>
    <div id="leftColumn">
      <div id="navcolumn">
           
  

  
    
  
  
    
                   <h5>General Info</h5>
            <ul>
              
    <li class="none">
                    <a href="index.html">About</a>
          </li>
              
    <li class="none">
                    <a href="plugin-info.html">Goals</a>
          </li>
              
    <li class="none">
              <strong>Usage</strong>
        </li>
          </ul>
              <h5>Project Documentation</h5>
            <ul>
              
                
              
      
              
        <li class="collapsed">
                    <a href="project-info.html">Project Information</a>
                </li>
              
                
              
      
            
      
              
        <li class="collapsed">
                    <a href="project-reports.html">Project Reports</a>
                </li>
          </ul>
                                           <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
            <img alt="Built by Maven" src="./images/logos/maven-feather.png"></img>
          </a>
                       
  

  
    
  
  
    
        </div>
    </div>
    <div id="bodyColumn">
      <div id="contentBox">
        <div class="section"><h2>How to Use</h2>
<p>Also make sure that you read <a href="http://incubator.apache.org/nmaven/environment-configuration.html" class="externalLink"> Configuration</a></p>
<div class="section"><h3>Pass-Through Compiler Commands</h3>
<p>There may be cases that the specific compiler option that you want to use may not be directly supported by the nmaven-compile-plugin. In this case, you can use the parameter(s) tag to pass through the command to the compiler. Be aware that the command filter specified within the compiler-plugins.xml may choose not to pass this parameter to the compiler. Typically, this will only be done for unsupported commands: (you will see a warn message in the output if this occurs).</p>
<div class="source"><pre>&lt;plugins&gt;
    &lt;plugin&gt;
        &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
        &lt;artifactId&gt;maven-compile-plugin&lt;/artifactId&gt;
        &lt;extensions&gt;true&lt;/extensions&gt;
        &lt;configuration&gt;
            &lt;parameters&gt;
                &lt;parameter&gt;/optimize+&lt;/parameter&gt;
            &lt;/parameters&gt;
        &lt;/configuration&gt;
    &lt;/plugin&gt;
&lt;/plugins&gt;</pre>
</div>
</div>
<div class="section"><h3>Setting Framework Version</h3>
<p>By default, the framework version for the main compile and the test compile are both 2.0.50727. To change this to version 1.1, set the &lt;frameworkVersion/&gt; &amp; &lt;testFramework/&gt; tags. Note that setting the &lt;frameworkVersion/&gt; to 1.1.4322, will not set the &lt;testFrameworkVersion/&gt;: you will need to set both if your project also includes NUnit tests.</p>
<div class="source"><pre>&lt;plugins&gt;
    &lt;plugin&gt;
        &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
        &lt;artifactId&gt;maven-compile-plugin&lt;/artifactId&gt;
        &lt;extensions&gt;true&lt;/extensions&gt;
        &lt;configuration&gt;
            &lt;parameters&gt;
                &lt;frameworkVersion&gt;1.1.4322&lt;/frameworkVersion&gt;
                &lt;testFrameworkVersion&gt;1.1.4322&lt;/testFrameworkVersion&gt;
            &lt;/parameters&gt;
        &lt;/configuration&gt;
    &lt;/plugin&gt;
&lt;/plugins&gt;</pre>
</div>
<p>The frameworkVersion is not supported for DotGNU: it depends on the target profile that the compiler was built under.</p>
</div>
<div class="section"><h3>Compiling for Multiple Platforms</h3>
<p>It is important to understand what setting the &lt;vendor/&gt; tag means for multi-platform builds.</p>
<ul><li>In the case of not setting the &lt;vendor/&gt; tag, NMaven will use the Microsoft compiler for the windows platform and MONO for all other platforms. By not specifying the vendor, you are indicating that the application should build with with both Microsoft and Mono compilers. For most development environments, Microsoft is installed on Windows, and Mono comes by default on many Linux distributions: so this option is usually a safe bet for multi-platform builds.</li>
<li>In the case of setting the &lt;vendor/&gt; tag to MICROSOFT, the application will only build under that compiler on Windows. If you are using any Microsoft specific APIs (or any of the missing APIs in MONO), then you should set the vendor tag to MICROSOFT.</li>
<li>In the case of setting the &lt;vendor/&gt; tag to MONO, the platform obviously must have Mono installed to be buildable. This option should be used if you are using any of the Mono specific APIs that you are not including within the dependency path of Maven.</li>
<li>In the case of setting the &lt;vendor/&gt; tag to DotGNU, the platform obviously must have DotGnu installed to be buildable. The DotGNU compiler is not included as a default for any of the platforms: so to target this environment, you must set the &lt;vendor/&gt; tag. Also you may run into some problems since there is currently no way to set the frameworkVersion/profile. I am giving some thought to this problem, so keep an eye on the documentation.</li>
</ul>
</div>
</div>

      </div>
    </div>
    <div class="clear">
      <hr/>
    </div>
    <div id="footer">
      <div class="xright">&#169;  
          2010
    
          NPanday
          
  

  
    
  
  
    
  </div>
      <div class="clear">
        <hr/>
      </div>
    </div>
  </body>
</html>
